package com.xiaotu.spring.config;

import com.xiaotu.spring.service.BeanAAA;
import com.xiaotu.spring.service.BeanBBB;
import com.xiaotu.spring.service.BeanCCC;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhangxiao
 * @create 2021-11-12 16:21
 */
@Configuration
public class AutowiredConfig {

    @Bean
    public BeanAAA beanAAA(BeanBBB beanBBB) {
        return new BeanAAA(beanBBB, getBeanCCC());
    }

    @Bean
    public BeanBBB beanBBB() {
        return new BeanBBB();
    }

    private BeanCCC getBeanCCC() {
        return new BeanCCC();
    }

}
